home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 2 / ads / a-stwiun < prev    next >
Text File  |  1996-02-12  |  11KB  |  369 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --           A D A . S T R I N G S . W I D E _ U N B O U N D E D            --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.6 $                              --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18. with Ada.Strings.Wide_Maps;
  19.  
  20. package Ada.Strings.Wide_Unbounded is
  21. pragma Preelaborate (Wide_Unbounded);
  22.  
  23.    type Unbounded_Wide_String is private;
  24.  
  25.    Null_Unbounded_Wide_String : constant Unbounded_Wide_String;
  26.  
  27.    function Length (Source : Unbounded_Wide_String) return Natural;
  28.  
  29.    type Wide_String_Access is access all Wide_String;
  30.  
  31.    procedure Free (X : in out Wide_String_Access);
  32.  
  33.    --------------------------------------------------------
  34.    -- Conversion, Concatenation, and Selection Functions --
  35.    --------------------------------------------------------
  36.  
  37.    function To_Unbounded_Wide_String
  38.      (Source : Wide_String)
  39.       return   Unbounded_Wide_String;
  40.  
  41.    function To_Unbounded_Wide_String
  42.      (Length : in Natural)
  43.       return   Unbounded_Wide_String;
  44.  
  45.    function To_Wide_String
  46.      (Source : Unbounded_Wide_String)
  47.       return   Wide_String;
  48.  
  49.    procedure Append
  50.      (Source   : in out Unbounded_Wide_String;
  51.       New_Item : in Unbounded_Wide_String);
  52.  
  53.    procedure Append
  54.      (Source   : in out Unbounded_Wide_String;
  55.       New_Item : in Wide_String);
  56.  
  57.    procedure Append
  58.      (Source   : in out Unbounded_Wide_String;
  59.       New_Item : in Wide_Character);
  60.  
  61.    function "&"
  62.      (Left, Right : Unbounded_Wide_String)
  63.       return        Unbounded_Wide_String;
  64.  
  65.    function "&"
  66.      (Left  : in Unbounded_Wide_String;
  67.       Right : in Wide_String)
  68.       return  Unbounded_Wide_String;
  69.  
  70.    function "&"
  71.      (Left  : in Wide_String;
  72.       Right : in Unbounded_Wide_String)
  73.       return  Unbounded_Wide_String;
  74.  
  75.    function "&"
  76.      (Left  : in Unbounded_Wide_String;
  77.       Right : in Wide_Character)
  78.       return  Unbounded_Wide_String;
  79.  
  80.    function "&"
  81.      (Left  : in Wide_Character;
  82.       Right : in Unbounded_Wide_String)
  83.       return  Unbounded_Wide_String;
  84.  
  85.    function Element
  86.      (Source : in Unbounded_Wide_String;
  87.       Index  : in Positive)
  88.       return   Wide_Character;
  89.  
  90.    procedure Replace_Element
  91.      (Source : in out Unbounded_Wide_String;
  92.       Index  : in Positive;
  93.       By     : Wide_Character);
  94.  
  95.    function Slice
  96.      (Source : in Unbounded_Wide_String;
  97.       Low    : in Positive;
  98.       High   : in Natural)
  99.       return   Wide_String;
  100.  
  101.    function "="
  102.      (Left  : in Unbounded_Wide_String;
  103.       Right : in Unbounded_Wide_String)
  104.       return  Boolean;
  105.  
  106.    function "="
  107.      (Left  : in Unbounded_Wide_String;
  108.       Right : in Wide_String)
  109.       return  Boolean;
  110.  
  111.    function "="
  112.      (Left  : in Wide_String;
  113.       Right : in Unbounded_Wide_String)
  114.       return  Boolean;
  115.  
  116.    function "<"
  117.      (Left  : in Unbounded_Wide_String;
  118.       Right : in Unbounded_Wide_String)
  119.       return  Boolean;
  120.  
  121.    function "<"
  122.      (Left  : in Unbounded_Wide_String;
  123.       Right : in Wide_String)
  124.       return  Boolean;
  125.  
  126.    function "<"
  127.      (Left  : in Wide_String;
  128.       Right : in Unbounded_Wide_String)
  129.       return  Boolean;
  130.  
  131.    function "<="
  132.      (Left  : in Unbounded_Wide_String;
  133.       Right : in Unbounded_Wide_String)
  134.       return  Boolean;
  135.  
  136.    function "<="
  137.      (Left  : in Unbounded_Wide_String;
  138.       Right : in Wide_String)
  139.       return  Boolean;
  140.  
  141.    function "<="
  142.      (Left  : in Wide_String;
  143.       Right : in Unbounded_Wide_String)
  144.       return  Boolean;
  145.  
  146.    function ">"
  147.      (Left  : in Unbounded_Wide_String;
  148.       Right : in Unbounded_Wide_String)
  149.       return  Boolean;
  150.  
  151.    function ">"
  152.      (Left  : in Unbounded_Wide_String;
  153.       Right : in Wide_String)
  154.       return  Boolean;
  155.  
  156.    function ">"
  157.      (Left  : in Wide_String;
  158.       Right : in Unbounded_Wide_String)
  159.       return  Boolean;
  160.  
  161.    function ">="
  162.      (Left  : in Unbounded_Wide_String;
  163.       Right : in Unbounded_Wide_String)
  164.       return  Boolean;
  165.  
  166.    function ">="
  167.      (Left  : in Unbounded_Wide_String;
  168.       Right : in Wide_String)
  169.       return  Boolean;
  170.  
  171.    function ">="
  172.      (Left  : in Wide_String;
  173.       Right : in Unbounded_Wide_String)
  174.       return  Boolean;
  175.  
  176.    ------------------------
  177.    -- Search Subprograms --
  178.    ------------------------
  179.  
  180.    function Index
  181.      (Source   : in Unbounded_Wide_String;
  182.       Pattern  : in Wide_String;
  183.       Going    : in Direction := Forward;
  184.       Mapping  : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
  185.       return     Natural;
  186.  
  187.    function Index
  188.      (Source   : in Unbounded_Wide_String;
  189.       Pattern  : in Wide_String;
  190.       Going    : in Direction := Forward;
  191.       Mapping  : in Wide_Maps.Wide_Character_Mapping_Function)
  192.       return     Natural;
  193.  
  194.    function Index
  195.      (Source : in Unbounded_Wide_String;
  196.       Set    : in Wide_Maps.Wide_Character_Set;
  197.       Test   : in Membership := Inside;
  198.       Going  : in Direction  := Forward)
  199.       return   Natural;
  200.  
  201.    function Index_Non_Blank
  202.      (Source : in Unbounded_Wide_String;
  203.       Going  : in Direction := Forward)
  204.       return   Natural;
  205.  
  206.    function Count
  207.      (Source  : in Unbounded_Wide_String;
  208.       Pattern : in Wide_String;
  209.       Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
  210.       return    Natural;
  211.  
  212.    function Count
  213.      (Source   : in Unbounded_Wide_String;
  214.       Pattern  : in Wide_String;
  215.       Mapping  : in Wide_Maps.Wide_Character_Mapping_Function)
  216.       return     Natural;
  217.  
  218.    function Count
  219.      (Source : in Unbounded_Wide_String;
  220.       Set    : in Wide_Maps.Wide_Character_Set)
  221.       return   Natural;
  222.  
  223.    procedure Find_Token
  224.      (Source : in Unbounded_Wide_String;
  225.       Set    : in Wide_Maps.Wide_Character_Set;
  226.       Test   : in Membership;
  227.       First  : out Positive;
  228.       Last   : out Natural);
  229.  
  230.    ------------------------------------
  231.    -- Wide_String Translation Subprograms --
  232.    ------------------------------------
  233.  
  234.    function Translate
  235.      (Source  : in Unbounded_Wide_String;
  236.       Mapping : in Wide_Maps.Wide_Character_Mapping)
  237.       return    Unbounded_Wide_String;
  238.  
  239.    procedure Translate
  240.      (Source  : in out Unbounded_Wide_String;
  241.       Mapping : Wide_Maps.Wide_Character_Mapping);
  242.  
  243.    function Translate
  244.      (Source  : in Unbounded_Wide_String;
  245.       Mapping : in Wide_Maps.Wide_Character_Mapping_Function)
  246.       return    Unbounded_Wide_String;
  247.  
  248.    procedure Translate
  249.      (Source  : in out Unbounded_Wide_String;
  250.       Mapping : in Wide_Maps.Wide_Character_Mapping_Function);
  251.  
  252.    ---------------------------------------
  253.    -- Wide_String Transformation Subprograms --
  254.    ---------------------------------------
  255.  
  256.    function Replace_Slice
  257.      (Source : in Unbounded_Wide_String;
  258.       Low    : in Positive;
  259.       High   : in Natural;
  260.       By     : in Wide_String)
  261.       return   Unbounded_Wide_String;
  262.  
  263.    procedure Replace_Slice
  264.      (Source   : in out Unbounded_Wide_String;
  265.       Low      : in Positive;
  266.       High     : in Natural;
  267.       By       : in Wide_String);
  268.  
  269.    function Insert
  270.      (Source   : in Unbounded_Wide_String;
  271.       Before   : in Positive;
  272.       New_Item : in Wide_String)
  273.       return     Unbounded_Wide_String;
  274.  
  275.    procedure Insert
  276.      (Source   : in out Unbounded_Wide_String;
  277.       Before   : in Positive;
  278.       New_Item : in Wide_String);
  279.  
  280.    function Overwrite
  281.      (Source   : in Unbounded_Wide_String;
  282.       Position : in Positive;
  283.       New_Item : in Wide_String)
  284.       return     Unbounded_Wide_String;
  285.  
  286.    procedure Overwrite
  287.      (Source    : in out Unbounded_Wide_String;
  288.       Position  : in Positive;
  289.       New_Item  : in Wide_String);
  290.  
  291.    function Delete
  292.      (Source  : in Unbounded_Wide_String;
  293.       From    : in Positive;
  294.       Through : in Natural)
  295.       return    Unbounded_Wide_String;
  296.  
  297.    procedure Delete
  298.      (Source  : in out Unbounded_Wide_String;
  299.       From    : in Positive;
  300.       Through : in Natural);
  301.  
  302.    function Trim
  303.      (Source : in Unbounded_Wide_String;
  304.       Side   : in Trim_End)
  305.       return   Unbounded_Wide_String;
  306.  
  307.    procedure Trim
  308.      (Source : in out Unbounded_Wide_String;
  309.       Side   : in Trim_End);
  310.  
  311.    function Trim
  312.      (Source : in Unbounded_Wide_String;
  313.       Left   : in Wide_Maps.Wide_Character_Set;
  314.       Right  : in Wide_Maps.Wide_Character_Set)
  315.       return   Unbounded_Wide_String;
  316.  
  317.    procedure Trim
  318.      (Source : in out Unbounded_Wide_String;
  319.       Left   : in Wide_Maps.Wide_Character_Set;
  320.       Right  : in Wide_Maps.Wide_Character_Set);
  321.  
  322.    function Head
  323.      (Source : in Unbounded_Wide_String;
  324.       Count  : in Natural;
  325.       Pad    : in Wide_Character := Wide_Space)
  326.       return   Unbounded_Wide_String;
  327.  
  328.    procedure Head
  329.      (Source : in out Unbounded_Wide_String;
  330.       Count  : in Natural;
  331.       Pad    : in Wide_Character := Wide_Space);
  332.  
  333.    function Tail
  334.      (Source : in Unbounded_Wide_String;
  335.       Count  : in Natural;
  336.       Pad    : in Wide_Character := Wide_Space)
  337.       return   Unbounded_Wide_String;
  338.  
  339.    procedure Tail
  340.      (Source : in out Unbounded_Wide_String;
  341.       Count  : in Natural;
  342.       Pad    : in Wide_Character := Wide_Space);
  343.  
  344.    function "*"
  345.      (Left  : in Natural;
  346.       Right : in Wide_Character)
  347.       return  Unbounded_Wide_String;
  348.  
  349.    function "*"
  350.      (Left  : in Natural;
  351.       Right : in Wide_String)
  352.       return  Unbounded_Wide_String;
  353.  
  354.    function "*"
  355.      (Left  : in Natural;
  356.       Right : in Unbounded_Wide_String)
  357.       return  Unbounded_Wide_String;
  358.  
  359. private
  360.  
  361.    type Unbounded_Wide_String is record
  362.       Reference : Wide_String_Access := new Wide_String'("");
  363.    end record;
  364.  
  365.    Null_Unbounded_Wide_String : constant Unbounded_Wide_String :=
  366.                              (Reference => new Wide_String'(""));
  367.  
  368. end Ada.Strings.Wide_Unbounded;
  369.